/**
 * 功能:对于app的sqlite进行的初始化操作
 * 创建日期: 2012-03-16
 * 创建人: 全轩
 * 功能修正说明:
 * 		
 */
if(!this.DataBase)
{
	this.DataBase = {};
}

(function(){
	
	if(!DataBase.tableNames)
	{
		//表名称
		DataBase.tableNames = 
		{
			users_logoninfo:'users_logoninfo',
			emotions:'emotions',
			emotions_view:'emotions_view',
			account:'account',
			accountmapping:'accountmapping',
			tweet:'tweet',
		}
	}
	
	if(!DataBase.dbInitSQL)
	{
		//表名称和对应的create语句
		DataBase.dbInitSQL = [
			{tableName:'emotions',initSQL: 'CREATE TABLE IF NOT EXISTS emotions (pid integer PRIMARY KEY, category text, common integer,hot integer,icon text,phrase text,picid integer,type text,url text,value text)'},
			{tableName:'users_logoninfo', initSQL:'CREATE TABLE IF NOT EXISTS users_logoninfo (pid integer PRIMARY KEY,uid integer,isdefault integer,istimeout integer, screen_name text, access_token text,access_tokensecret text,code text,access_token_gettime text ,last_logontime text, logon_count integer)'},
			{tableName:'emotions_view',initSQL:'CREATE VIEW if not exists emotions_view AS SELECT DISTINCT category FROM emotions'},
			{tableName:'account',initSQL:'CREATE TABLE IF NOT EXISTS account (pid integer PRIMARY KEY,accountid integer,teein_parentid integer,name text,displayname text,isdefault integer,type text,password text,phone text,address text,company text,teein_accountid integer,issync integer,create_at text,logincount integer,lastlogintime text)'},
			{tableName:'accountmapping',initSQL:'CREATE TABLE IF NOT EXISTS accountmapping (pid integer PRIMARY KEY,accountid integer,uid integer,isdefault integer)'},
			{tableName:'tweet',initSQL:'CREATE TABLE IF NOT EXISTS tweet (pid integer PRIMARY KEY,created_at text,id integer,tweet_text text,source text,favorited text,truncated text,in_reply_to_status_id integer,in_reply_to_user_id integer,in_reply_to_screen_name text,geo text,mid text,reposts_count integer,comments_count integer,annotations text,user text)'},
	    ]
	}
}())

//SinaApp.DataBase = DataBase;